package ru.nstu.isma.core.lang.error;

/**
 * Created with IntelliJ IDEA.
 * User: Admin
 * Date: 04.01.14
 * Time: 22:00
 * To change this template use File | Settings | File Templates.
 */
public class Error {
    private int row = -1;

    private int col = -1;

    private String msg;

    public Error(int row, int col, String msg) {
        this.row = row;
        this.col = col;
        this.msg = msg;
    }

    public Error(String msg) {
        this.msg = msg;
    }

    public int getRow() {
        return row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getCol() {
        return col;
    }

    public void setCol(int col) {
        this.col = col;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("Error:");
        sb.append("(");
        sb.append(row);
        sb.append(", ");
        sb.append(col);
        sb.append(") ");
        sb.append(msg);
        return sb.toString();
    }
}
